package com.sky.client;

import com.sky.entity.ShoppingCart;
import com.sky.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "sky-server-cart")
public interface ShoppingCartClient {
    
    /**
     * 根据用户id查询购物车列表
     * @param shoppingCart
     * @return
     */
    @GetMapping("/user/shoppingCart/list")
    Result<List<ShoppingCart>> list(@RequestBody ShoppingCart shoppingCart);
    
    /**
     * 根据用户id删除购物车
     * @param userId
     * @return
     */
    @DeleteMapping("/user/shoppingCart/clean/{userId}")
    Result deleteByUserId(@PathVariable("userId") Long userId);
}